#ifndef INTERFACE_H
#define INTERFACE_H

#include <QtCore/QList>
#include "AdvancedEditor.h"

class QAction;
class QMenu;
class QToolBar;
class QComboBox;
class SessionsManager;
class AboutEditorDialog;
class InformationDialog;
	
typedef QList<QAction *> ActionsList;
typedef QList<QWidget *> WidgetsList;

class Interface : public AdvancedEditor
{
	Q_OBJECT
	signals:
		void changeWindowTitle(const QString& title);
		void quit();
	public:
		Interface(QWidget *parent = 0);
		~Interface();
		
		void saveSettings();
	
		QMenu *getFilesManagementMenu() const;
		QMenu *getEditionMenu() const;
		QMenu *getToolsMenu() const;
	
		QToolBar *getToolBar() const;
	
		const WidgetsList& getWidgetsForStatusBar() const; 
	
		const ActionsList& getFilesManagementActions() const;
		const ActionsList& getEditionActions() const;
		const ActionsList& getToolsActions() const;
		const ActionsList& getInvisibleActions() const;
		const ActionsList& getHelpActions() const;
	private slots:
		void showContextMenu(int globalX,int globalY);
		void currentEditorChanged(Editor *currentEditor);
		void changeSyntax(int syntaxIndex);
		void emitSignalToChangeWindowTitle(const QString& fileName);
		void emitSignalToChangeWindowTitleBecauseOfSession(const QString& sessionName);
	private:
		void loadPlugins();
	
		ActionsList filesManagementActions;
		ActionsList editionActions;
		ActionsList toolsActions;
		ActionsList helpActions;
		ActionsList invisibleActions;
	
		QMenu *fileMenu;
		QMenu *editionMenu;
		QMenu *toolsMenu;
		QMenu *contextMenu;
	
		QToolBar *toolBar;
		
		SessionsManager *sessionsManager;
		AboutEditorDialog *aboutEditorDialog;
		InformationDialog *informationDialog;

		WidgetsList widgetsForStatusBar;
		QComboBox *changeSyntaxComboBox;
		QComboBox *changeEncodingComboBox;
		QComboBox *changeLinesEndFormatComboBox;
};

#endif
